package com.aicheyoudao;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class Parser {

	public static ArrayList<shopBean> parseSerPoi(String json)
			throws JSONException {
		JSONArray jsonArr = new JSONArray(json);
		ArrayList<shopBean> shops = new ArrayList<shopBean>();
		for (int i = 0; i < jsonArr.length(); i++) {
			JSONObject obj = jsonArr.getJSONObject(i);
			shopBean bean = new shopBean();
			bean.setShopName(obj.getString("shopname"));
			bean.setPhoneNum(obj.getString("shopphone"));
			bean.setAddress(obj.getString("shopaddress"));
			shops.add(bean);
		}
		return shops;
	}

}
